﻿<Page x:Class="TableTop.Presentation.Pages.CharacterSheetEditorPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:local="clr-namespace:TableTop.Presentation.Controls"
      mc:Ignorable="d" 
      d:DesignHeight="300" d:DesignWidth="600"
	  Title="Write a new character sheet">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" MinHeight="35"/>
            <RowDefinition />
        </Grid.RowDefinitions>
        
        <local:GlassContainer Grid.Row="0" Background="LightGray">
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="5,0,5,0">
                <TextBlock Text="Choose an addon to use: " VerticalAlignment="Center"/>
                <ComboBox Width="200" Margin="5,0,5,0" VerticalAlignment="Center"
                          Name="cmbAddons">          
                    <ComboBox.ItemContainerStyle>
                        <Style TargetType="{x:Type ComboBoxItem}">
                            <Setter Property="Template">
                                <Setter.Value>
                                    <ControlTemplate>
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="Auto" />
                                                <ColumnDefinition Width="Auto" />
                                            </Grid.ColumnDefinitions>
                                            <Image Source="{Binding AddonIcon}" 
                                                   Grid.Column="0"
                                                   Width="32" 
                                                   Height="32" 
                                                   Margin="5,5,5,5"
                                                   VerticalAlignment="Center"/>
                                            <StackPanel Grid.Column="1">
                                                <TextBlock Margin="5,5,5,5" Text="{Binding Name}" 
                                                           FontSize="14"
                                                           FontWeight="Bold"/>
                                                <TextBlock Margin="5,5,5,5" 
                                                           Text="{Binding Description}" 
                                                           FontStyle="Italic"/>
                                            </StackPanel>
                                        </Grid>
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                        </Style>
                    </ComboBox.ItemContainerStyle>
                    <ComboBox.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <Image Source="{Binding AddonIcon}" 
                                                   Width="16" 
                                                   Height="16" 
                                                   Margin="5,5,5,5"
                                                   VerticalAlignment="Center"/>
                                <TextBlock Text="{Binding Name}" Margin="5,0,5,0"
                                           VerticalAlignment="Center"/>
                            </StackPanel>                            
                        </DataTemplate>
                    </ComboBox.ItemTemplate>
                </ComboBox>
                <local:GlassButton Content="Create new" Margin="5,0,5,0" VerticalAlignment="Center" 
                                   Foreground="White"
                                   x:Name="btnCreateNew" 
                                   Click="btnCreateNew_Click"/>
                <local:GlassButton Content="Close current" Margin="5,0,5,0" VerticalAlignment="Center" 
                                   Foreground="White"
                                   x:Name="btnCloseCurrent" 
                                   Click="btnCloseCurrent_Click"/>
            </StackPanel>
        </local:GlassContainer>  
        
        <ContentPresenter Grid.Row="1" Name="SheetsPanel" />
    </Grid>
</Page>
